#ifndef MESSAGEPARSER
#define MESSAGEPARSER

#include <string>
#include <vector>
#include "DataTypes.h"
#include "HeaderParser.hpp"
#include "message.h"
class MessageParser
{
public:
    MessageParser(){}
    bool isValidMessageAvaliable(const Data& p_msg);
    Message parse(const Data& rawMsg);
    Data getMessageData(const Data& p_msg);
    std::vector<std::pair<Data, Data > > extractParametersFromMessage(const Data& msgParams);
private:
    char getSid(const Data& p_msg, unsigned int startPos);
    void validateChecksum(const Data& p_msg, unsigned int checksumPos) const;
    Data decodeMessageDataToHumanReadable(const Data& p_msg, size_t startPos);
    HeaderParser m_headerParser;

};


#endif
